var flag = false;
function toinput() {
	var forms = document.getElementById("fms");

	forms.elements[0].style.color = "gray";
	forms.elements[1].readOnly = false;
	forms.elements[2].readOnly = false;
	forms.elements[3].readOnly = false;
	forms.elements[4].readOnly = false;
	forms.elements[5].readOnly = false;
	flag = true;
	document.getElementById("msg").innerHTML = "已进入修改模式";

}

function checkForm1() {
	if (!flag)
		return false;
	var forms = document.getElementById("fms");
	var age = forms.elements[1].value;
	var email = forms.elements[2].value;
	var sex = forms.elements[3].value;
	var height = forms.elements[4].value;
	var weight = forms.elements[5].value;

	if (!/(^[1-9]*\d$)/.test(age)
			|| !/(^[0-9]+\.{0,1}[0-9]{0,2}$)/.test(height)
			|| !/(^[0-9]+\.{0,1}[0-9]{0,2}$)/.test(weight)) {
		document.getElementById("msg").innerHTML = "亲,请正确使用阿拉伯数字";
		return false;
	} else if (age > 120 || height < 50 || height > 250) {
		document.getElementById("msg").innerHTML = "亲?您是外星人?";
		return false;
	}
	if (!/(^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$)/.test(email)) {
		document.getElementById("msg").innerHTML = " 邮箱格式不正确";
		return false;
	}
	return true;
}